package log

import (
	"github.com/magicianlyx/GoLog"
)

var (
	serviceName string
	log         *GoLog.Logger
	debug       *GoLog.Logger
)

func InitDefault() {
	Init("dev", "web_facade")
}

func Init(environment string, service string) {
	serviceName = service
	writers := make([]GoLog.ILogWrite, 0)
	console := GoLog.NewConsoleLog()
	writers = append(writers, console)

	attach := make(map[string]interface{})
	attach["environment"] = environment
	attach["service_name"] = service
	log = GoLog.NewLogger(writers, nil, nil, service, attach)

}

func Stop() {
	log.Stop()
}
